﻿<section>
  <div class="page-header">
    <h1>
      Articles
      <a class="btn btn-primary pull-right" data-ui-sref="admin.articles.create">
        <i class="glyphicon glyphicon-plus"></i>
      </a>
    </h1>
  </div>
  <div class="list-group">
    <a data-ng-repeat="article in vm.articles" data-ui-sref="admin.articles.edit({articleId: article._id})" class="list-group-item">
      <small class="list-group-item-text">
        Posted on
        <span data-ng-bind="article.created | date:'mediumDate'"></span>
        by
        <span ng-if="article.user" ng-bind="article.user.displayName"></span>
        <span ng-if="!article.user">Deleted User</span>
      </small>
      <h4 class="list-group-item-heading" data-ng-bind="article.title"></h4>
      <p class="list-group-item-text" data-ng-bind="article.content"></p>
    </a>
  </div>
  <div class="alert alert-warning text-center" data-ng-if="articles.$resolved && !articles.length">
    No articles yet, why don't you <a data-ui-sref="admin.articles.create">create one</a>?
  </div>
</section>
